package homework12月8号.homework1.h3;

import java.lang.reflect.Constructor;

/*2.	有参构造
下面有一个 Student类，使用反射创建Student对象
public class Student{
private String name；
  public Student (String name){
        this.name=name;
        System.out.println("有参构造方法执行了 呵呵呵 ");
    }
}
*/
public class Demo1 {
    public static void main(String[] args) throws Exception {
        Class<?> aClass = Class.forName("czxy.homework.h3.Student");
        Constructor<?> c = aClass.getDeclaredConstructor(String.class);
        c.newInstance("haha");
    }
}
